package
{
	import laya.events.Event;
	import laya.net.HttpRequest;
	import laya.utils.Handler;

	/**
	 *@date 2017-2-15 上午11:52:12
	 *@author zhouhonghui
	 */
	public class HttpReqDemo
	{
		private var _http:HttpRequest;
		public function HttpReqDemo()
		{
			_http = new HttpRequest();
			_http.once(Event.PROGRESS,this,onProgress);
			_http.once(Event.COMPLETE,this,onComplete);
			_http.once(Event.ERROR,this,onError);
			_http.send('http://127.0.0.1:5000/api/v1.0/posts/',null,'get','text',['Access-Control-Allow-Origin',"*"]);
		}
		
		private function onError(e:*=null):void
		{
			// TODO Auto Generated method stub
			
		}
		
		private function onComplete(e:*=null):void
		{
			// TODO Auto Generated method stub
			trace('_http.data==',_http.data);
		}
		
		private function onProgress(e:*=null):void
		{
			// TODO Auto Generated method stub
			
		}
	}
}